

  The functions in the Array Library extend ArmBob to allow some vector
  and matrix operations to be performed.

  It is supposed that the elements of numerical input arrays are either
  all of type INTEGER or all of type REAL. If the input arrays are both
  of type INTEGER, the output will be of type INTEGER, except for
  inverse(); otherwise the output will be of type REAL. A few of the
  functions can deal with arrays of mixed types, but this should not be
  relied on as it can lead to errors that are not detected. Arrays of
  mixed types can always be converted to REAL arrays by using the
  function multiple() with the REAL factor 1.0.  

  Variables of type VECTOR are treated as row vectors, but it may be
  expedient to treat row vectors as 1xn matrices and column vectors as
  nx1 matrices for consistency, so functions form_row() and
  form_column() are provided for conversions: both are special cases of
  form_matrix().  

  Arrays with elements of type STRING can be formed with form_matrix()
  or form_column() or form_row(), concatenated with concat() and printed
  with printarray(). No other array functions can be used with string
  arrays.

  Nearly all the array functions use the auxiliary function newmatrix(),
  and printarray() uses the function format(), so these functions are
  provided with the Array Library.

  Input

  form_matrix(m,n,v)
    Returns an m x n matrix from a VECTOR v of size m*n, whose rows are
    successive sets of n elements of the vector. The elements of v should
    be all INTEGER, all REAL or all STRING. An error is given if the
    vector v is not of size m*n.
  
  form_column(v)
    Returns a column vector from a VECTOR v. The elements of v should be all
    INTEGER or all REAL. It is a special case of form_matrix().

  form_row(v)
    Returns a row vector from a VECTOR v. The elements of v should be all
    INTEGER or all REAL. It is a special case of form_matrix(); also a
    VECTOR is treated as a row vector, so this function is only included
    for convenience. 

  Output

  printarray(A,l,p)
    Prints the elements of an array (matrix or vector) A in successive
    rows, each with field width l, and with p digits after the decimal
    point for REAL elements by using format().

  format(n,l,p)
    Formats variables of types INTEGER, REAL and STRING for output. It
    converts REAL or INTEGER numbers n to signed decimal strings, with p
    digits after the decimal point for reals (p is irrelevant for integers
    and strings), and returns them, or strings n, either padded with
    leading spaces to make their lengths up to l or, if l is too small (in
    particular if l = 0), at full length without any leading spaces.

  Manipulation

  add(c,A)
    Returns the result of adding the constant c to every element of the
    array (matrix or vector) A.

  sum(A,B)
    Returns the array sum A + B of matrices or vectors A and B. An error
    is given when the arrays are incompatible for addition.

  multiple(c,A)
    Returns the result of multiplying every element of the array (matrix
    or vector) A by the constant c.

  product(A,B)
    Returns the matrix product A.B of the array A (matrix or row vector)
    and the matrix B. An error is given when the arrays are incompatible
    for multiplication.

  trace(A)
    Returns the trace of the square matrix A. An error is given when A is
    not square.

  transpose(A)
    Returns the transpose of the matrix A.

  inverse(A)
    Returns the inverse of a non-singular square matrix A, formed by using
    elementary row operations. The elements of d can be INTEGER or REAL,
    but the elements of the inverse will be REAL. Errors are given if A is
    not square or is singular. Elements with absolute values less than
    norm(A)/1000000 are set to zero. It uses the function abs().

  concat(A,B)
   Returns the array concatenation A + B of the STRING arrays A and B
   (matrices or vectors). An error is given when the arrays are not
   compatible.

  Auxiliary functions

  newmatrix(m,n)
    Returns a new m x n matrix with elements of type NIL.

  abs(n)
    Returns the absolute value of a REAL variable n. Used by inverse().

  int_10(n)
    Returns an INTEGER n as a decimal string. Used by format().
